package com.example.mobile2032021606130zlw0401;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    int i=1;
    private TextView textView;
    private ImageView imageView;
    private Button button;
    private Button button2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
    }

    private void initView() {
        textView = (TextView) findViewById(R.id.textView);
        imageView = (ImageView) findViewById(R.id.imageView);
        button = (Button) findViewById(R.id.button);
        button2 = (Button) findViewById(R.id.button2);
    }
    public void dakaib(View v){
         imageView.setImageResource(R.drawable.kaideng);
    }
    public void dakaib2(View v){
        imageView.setImageResource(R.drawable.guandeng);
    }
    public void dakaib3(View v){
        if (i==1){
            imageView.setImageResource(R.drawable.dakai);
            i++;
        }else {
            imageView.setImageResource(R.drawable.guanbi);
            i--;
        }
    }
}